//
//  AuthorizationManager.m
//  objective_c_language
//
//  Created by 王玉龙 on 2018/6/1.
//  Copyright © 2018年 longlong. All rights reserved.
//

#import "AuthorizationManager.h"
#import "DataLocalManager.h"
#import "LoginViewController.h"
#import "UINavigationController+TransitionAnimation.h"

@implementation AuthorizationManager

+ (BOOL)isAuthorization
{
    if ([DataLocalManager readAccount].length > 0 && [DataLocalManager readPassword].length > 0)
    {
        return YES;
    }
    return NO;
}

+ (void)accessPermission
{
    LoginViewController *loginVC = [[LoginViewController alloc] init];
    UINavigationController *loginNav = [[UINavigationController alloc] initWithRootViewController:loginVC];
    loginNav.delegate = loginNav;
    loginNav.transitionType = TransitionAnimationTypeFlip;
    loginNav.navigationBarHidden = YES;
    UIApplication.sharedApplication.keyWindow.rootViewController = loginNav;
}

@end
